<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html>

	<head>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

		<title><?=SYSTEM_TITLE?></title>

		<link href="<?=base_url("assets/css/bootstrap.min.css")?>" rel="stylesheet">
		<link href="<?=base_url("assets/font-awesome/css/font-awesome.css")?>" rel="stylesheet">

		<link href="<?=base_url("assets/css/plugins/summernote/summernote.css")?>" rel="stylesheet">
		<link href="<?=base_url("assets/css/plugins/summernote/summernote-bs3.css")?>" rel="stylesheet">
		
		<link href="<?=base_url("assets/css/animate.css")?>" rel="stylesheet">
		<link href="<?=base_url("assets/css/style.css")?>" rel="stylesheet">


		
	</head>

	<body>

		<?$this->load->view("templates/header")?>

        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
				<div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>修改设置</h5>
                    </div>
                    <div class="ibox-content">
                        <?//var_dump($config)?>
						<form action="<?=site_url("main/submit_config")?>" method="post" class="form-horizontal">
							<input type="hidden" name="cfg_id" value="<?=$config["cfg_id"]?>">
							<div class="form-group">
								<label class="col-sm-2 control-label">代码</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" name="cfg_key" value="<?=$config["cfg_key"]?>" disabled>
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							
							<div class="form-group">
								<label class="col-sm-2 control-label">说明</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" name="cfg_description" value="<?=$config["cfg_description"]?>" disabled>
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							
							<?if($config["cfg_key"] == "SYSTEM_INTRO"){?>
							<div class="form-group">
								<label class="col-sm-2 control-label">正文内容</label>
								<div class="col-sm-10">
									<textarea class="summernote" name="cfg_value" ><?=$config["cfg_value"]?></textarea>
								</div>
							</div>
							<?}else{?>
							<div class="form-group">
								<label class="col-sm-2 control-label">值</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" name="cfg_value" value="<?=$config["cfg_value"]?>">
								</div>
							</div>
							<?}?>
							
							<div class="hr-line-dashed"></div>
							
							<div class="form-group">
								<div class="col-sm-4 col-sm-offset-2">
									<button class="btn btn-primary" type="submit">提交</button>
									<a class="btn btn-default" type="submit" href="<?=site_url("main/config_management")?>">返回</a>
								</div>
							</div>

						</form>	
					</div>
				</div>
            </div>
		</div>

		<?$this->load->view("templates/footer")?>

		<!-- Mainly scripts -->
		<script src="<?=base_url("assets/js/jquery-3.1.1.min.js")?>"></script>
		<script src="<?=base_url("assets/js/bootstrap.min.js")?>"></script>
		<script src="<?=base_url("assets/js/plugins/metisMenu/jquery.metisMenu.js")?>"></script>
		<script src="<?=base_url("assets/js/plugins/slimscroll/jquery.slimscroll.min.js")?>"></script>

		<!-- Custom and plugin javascript -->
		<script src="<?=base_url("assets/js/inspinia.js")?>"></script>
		<script src="<?=base_url("assets/js/plugins/pace/pace.min.js")?>"></script>

		<!-- SUMMERNOTE -->
		<script src="<?=base_url("assets/js/plugins/summernote/summernote.min.js")?>"></script>
		<script>
		$(document).ready(function(){
			<?if($config["cfg_key"] == "SYSTEM_INTRO"){?>
			$('.summernote').summernote({
				height: 480,
				placeholder: '在这里输入文章内容...'
			});
			<?}?>
			
		});

		</script>
		<?$this->load->view("templates/script")?>
	</body>

</html>
